﻿<%@ Page Title="" Language="C#" MasterPageFile="~/manager.Master" AutoEventWireup="true" CodeBehind="report_mount.aspx.cs" Inherits="Bus_proj.website.report_mount" %>
<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>
<%@ Register assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" namespace="CrystalDecisions.Web" tagprefix="CR" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="../Styles/Stylebuttoncss.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/textbox.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            width: 179px;
        }
        .style3
        {
            width: 217px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<fieldset >
<legend>เลือกวัน-เดือน-ปีที่ต้องการแสดงรายรับ</legend>
<table class="style1">
        <tr>
            <td align="right" class="style2">
                &nbsp;</td>
            <td class="style3">
                &nbsp;</td>
            <td rowspan="4">
                <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="ค้นหา" 
                    Height="40px" Width="111px" CssClass="classname" />
            </td>
        </tr>
        <tr>
            <td align="right" class="style2">
                <asp:Label ID="Label1" runat="server" Text="วัน-เดือน-ปี เริ่มต้น :"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="TextBox1" runat="server" Height="22px" TextMode="Date" 
                    Width="176px" CssClass="textbox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" class="style2">
                <asp:Label ID="Label2" runat="server" Text="วัน-เดือน-ปี สิ้นสุด :"></asp:Label>
            </td>
            <td class="style3">
                <asp:TextBox ID="TextBox2" runat="server" Height="21px" TextMode="Date" 
                    Width="176px" CssClass="textbox"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="right" class="style2">
                &nbsp;</td>
            <td class="style3">
                <asp:RadioButtonList ID="RadioButtonList1" runat="server" 
                    RepeatDirection="Horizontal" Width="135px">
                    <asp:ListItem Selected="True" Value="1">จำหน่าย</asp:ListItem>
                    <asp:ListItem Value="2">จอง</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
    </table>
</fieldset>
&nbsp;<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:Bus_proConnectionString %>" 
        
        SelectCommand="SELECT Table_Sale.Sale_id, Table_Sale.Passenger_id, Table_Sale.Sale_date, Table_Sale.Sale_time, Table_Sale.Promotion_id, Table_Sale.Point_id, Table_Sale.Personnel_id, Table_Sale.Around_id, Table_Sale.SSID, Table_SaleDetail.Seat_id, Table_SaleDetail.Seat_no, Table_SaleDetail.Sale_id AS Expr1, Table_SaleDetail.Price_ticket, Table_SaleDetail.tex, Table_SaleDetail.Around_id ,Table_Promotion.Promotion_discount,Table_Category.Category_Discount
FROM Table_Sale 
INNER JOIN Table_SaleDetail 
ON Table_Sale.Sale_id = Table_SaleDetail.Sale_id 
inner join Table_Promotion
on Table_Sale.Promotion_id = Table_Promotion.Promotion_id
inner join Table_Passenger
on Table_Sale.Passenger_id = Table_Passenger.Passenger_id
Inner join Table_Category
on Table_Passenger.Category_id = Table_Category.Category_id
 WHERE (Table_Sale.Sale_time BETWEEN @start_date AND @end_date) and SSID = @status">
        <SelectParameters>
            <asp:SessionParameter Name="start_date" SessionField="start_date" 
                DefaultValue="1900-01-01 00:00:00" />
            <asp:SessionParameter Name="end_date" SessionField="end_date" 
                DefaultValue="1900-01-01 23:00:00" />
            <asp:SessionParameter DefaultValue="" Name="status" SessionField="status" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:Panel ID="Panel1" runat="server">
        <table class="style1">
            <tr align="center">
                <td >
                    <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
                        Font-Size="8pt" InteractiveDeviceInfos="(Collection)" 
                        WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="647px">
                        <LocalReport ReportPath="website\Report_show.rdlc">
                            <DataSources>
                                <rsweb:ReportDataSource DataSourceId="SqlDataSource1" Name="DataSet1" />
                            </DataSources>
                        </LocalReport>
                    </rsweb:ReportViewer>
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
